layui.use(['layer', 'form', 'admin', 'laydate', 'ax','layarea'], function () {
    var $ = layui.jquery;
    var $ax = layui.ax;
    var form = layui.form;
    var admin = layui.admin;
    var laydate = layui.laydate;
    var layer = layui.layer;
    var layarea = layui.layarea;


    // 表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        data.field.userProfitId = Feng.getUrlParam("userProfitId")

        if(data.field.state == -1 && !data.field.remarks){
            Feng.error("请输入不通过原因！")
        }
        var ajax = new $ax(Feng.ctxPath + "/exam/extractProfit", function (data) {
            Feng.success("添加成功！");
            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);
            //关掉对话框
            admin.closeThisDialog();
        }, function (data) {
            Feng.error("添加失败！" + data.responseJSON.message)
        });
        ajax.set(data.field);
        ajax.start();
    });
});